home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-13 | 4.6 KB | 129 lines | [TEXT/MMCC] |
- Greg Anderson
- October 1994
-
-
- About the program "Finder Tricks"
- ---------------------------------
- Perhaps not as amusing as Letterman (which I never watch),
- this sample application will make your Finder do stupid
- tricks.
-
- WARNING: The software-engineering-general has determined
- that casual use of this program may cause extreme annoyance.
- Use only as directed. Not for resale.
-
-
- Okay, what sort of stupid tricks can my Finder do?
- --------------------------------------------------
- Exchange custom icons of items in front window: This is the most
- annoying trick you can do. If this button is clicked, then every
- item in the frontmost window will be given a custom icon which will
- be taken from some other item in the window. If all of the items
- have the same icon, then you won't see anything happen. If all of
- the icons are different, then you'll probably be quite displeased
- with the result. Use the next trick to undo the damage--if you
- don't have any custom icons in the window that you'd like to keep!
-
- Remove custom icons from selected items: As the name says, the
- custom icons on every selected item are deleted. They won't come
- back, so don't use this on items with custom icons you'd like to
- keep around!
-
- Reveal owner of frontmost window: Somewhat useful; shows and selects
- the item that belongs to the frontmost window.
-
- Share selected folders: Doesn't work if file sharing isn't turned
- on; if sharing is on, then every folder in the current selection
- will be shared.
-
- Hey, I warned you that these were pretty stupid tricks. The
- goal is to demonstrate how to use the Scriptable Finder; doing
- something useful is of secondary importance in this application.
-
-
- How the Source is organized
- ---------------------------
- Finder tricks consists of a number of source files, some of which
- stand on their own, and some of which require support from
- other files in the project. It uses the same mini-framework
- that I used in Zawphing and some other sample applications
- I've written.
-
-
- The main files that define the application "Finder Tricks" are:
-
- Main.cp Initializes the Macintosh toolbox and
- begins execution of the application.
-
- SendFinderTricks.cp The code that actually sends AppleEvents
- to the Scriptable Finder.
-
- TricksDialog.cp This code manages the modeless dialog
- used in this application.
-
- MenuTable.cp A list of function pointers to routines that
- handle the various menu selections. If I had
- a gApplication object and real event dispatching,
- I wouldn't need this silly table.
-
- AboutBox.cp An important file, despite the fact that
- it doesn't do very much.
-
-
- The "Mini-application framework" is defined by the following
- sources:
-
-
- EventHandler.cp Calls WaitNextEvent and dispatches events
- to the appropriate handlers.
-
- MenuHandler.cp Manages application menus. This code is
- old and rather sub-optimal, but it works
- well enough for a simple sample app.
-
- WindowHandler.cp Abstract code that defines a set of virtuals
- that are called by the event handler. Includes
- a class for modeless dialog boxes that handles
- such things as changing the cursor shape to an
- I-beam when it passes over an EditText item.
-
-
- The primary utilities of note are:
-
- AppleEventUtilities.cp A stand-alone set of C++ wrappers for
- the AppleEvent manager. Includes useful
- classes for accessing parameters in
- records, iterating items in lists, and
- building descriptors, lists and records.
-
- Exceptions.cp Very useful code that implements a failure
- handler with Try/Catch semantics. (No dependancies)
-
- ReportError.cp Code that converts O.S. errors into descriptive
- strings. Uses DialogUtilities and StringUtilities.
- Requires DLOG id 30303 and TEXT id 30303.
-
- DialogUtilities.cp Useful code that helps manage modal and modeless
- dialog boxes. Requires StringUtilities.
-
- NextEvent.cp Old code that used to abstract WaitNextEvent
- vs. GetNextEvent for running on System 6 without
- MultiFinder (yes, very old code!). Had some
- problems with native code, so now it just calls
- WaitNextEvent directly, and therefore is of
- marginal value.
- Uses MacUtilities.cp.
-
- MacUtilities.cp Simple, useful routines that many Macintosh
- applications will use. (No dependancies)
-
- StringUtilities.cp Simple code that manages C and Pascal strings.
- Not as useful as a real string class, but better
- than nothing. (No dependancies)
-
-
- And, a header not yet in the standard set but used by Finder Tricks:
-
- FinderRegistry.h Defines classes, properties, data types and
- error codes used by the Scriptable Finder.
-